//
//  Macros.h
//  WC
//
//  Created by 杨鑫 on 15/4/13.
//  Copyright (c) 2015年 智康. All rights reserved.
//
#import <CoreGraphics/CGGeometry.h>
#import <UIKit/UIScreen.h>
#import "MyUtil.h"


#import "WCCoreDataStore.h"
#import "WCDefaultManager.h"
#import "WCNetworkAccessManager.h"
#import "WCPopupLayerManager.h"
#import "MJRefresh.h"
#import "NSString+Utilities.h"
#warning 矫正像素点的一些方法

#ifndef WC_Macros_h
#define WC_Macros_h


//护理服务类型
typedef NS_ENUM(NSInteger, NURSECARETYPE) {
    NURSECARETYPE_CARE_OUTPATIENT,
    NURSECARETYPE_MEET_CONSULTATION,
    NURSECARETYPE_ONLINE_CONSULTATION
};
enum LineDrection {
    kLineHorizontal,
    kLineVertical
};
typedef enum LineDrection LineDrection;

enum PointCorner {
    kPointLeftTop,
    kPointLeftBottom,
    kPointRightTop,
    kPointRightBottom
};
typedef enum PointCorner PointCorner;

CG_INLINE CGPoint
CGPointPathChange(CGPoint p, LineDrection drection, int d)
{
    CGFloat scale = [UIScreen mainScreen].scale;
    int scaleX = p.x*scale;
    int scaleY = p.y*scale;

    CGPoint change;
    if (drection == kLineHorizontal) {
        change.x = scaleX/scale;
        change.y = (scaleY+0.5*d)/scale;
    } else {
        change.x = (scaleX+0.5*d)/scale;
        change.y = scaleY/scale;
    }
    
    return change;
}

#endif

#define kScreenHeight   ([UIScreen mainScreen].bounds.size.height)
#define kScreenWidth    ([UIScreen mainScreen].bounds.size.width)
#define kScreenFrame    (CGRectMake(0,0,kScreenWidth,kScreenHeight))
#define kWithOutNanBarFrame    (CGRectMake(0,64,kScreenWidth,kScreenHeight-64))
#define kOnePX (1.0/[UIScreen mainScreen].scale)

#define font(x) [UIFont systemFontOfSize:x]

#define ImageName(name) [NSString stringWithFormat:@"%@@%dx", name, (int)[UIScreen mainScreen].scale]
#define ImageAndType(fileName, type) [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:fileName ofType:type]]
#define Image(fileName) [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:fileName ofType:nil]]
#define ImageOriginal(name) [[UIImage imageNamed:name] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]

#define HexRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
#define HexRGBAlpha(rgbValue,a) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:(a)]
#define HexRGB_WSJ(x,y,z) [UIColor colorWithRed:(x)/255.0 green:(y)/255.0 blue:(z)/255.0 alpha:1.0]

#define kAppBg HexRGB(0xf8f8f8)
#define kTxtColor HexRGB(0x5e606d)
#define kBorderColor HexRGB(0xdedede)

#define WSJSHOW(message)  [CoreSVP showSVPWithType:CoreSVPTypeCenterMsg Msg:(message) duration:1.0f allowEdit:NO beginBlock:nil completeBlock:nil];
#define kServiceConifg_part @"nurse/account/service/config/"

#define kUpdateSeviceConfig_part @"nurse/account/service/config/"

#define kSerViceTime_nnused @"serviceTime/getUnusedServiceTime"
#define kServiceTime_used @"serviceTime/getUsedServiceTime"
#define kUpdateTimeData @"nurse/service/time/setting/save"

#define kAvailableTimes @"serviceTime/getByAppointment"
#define kAppointNextTime @"nursing/order/appointment/next"


#define kFans_part @"nurseFans/findFansById"
#define kOrderPatient @"nursing/order/list"
#define kAddressListUrl @"nursing/record/getPatientAddressListByPatientId"

#define kMyMessageUrl_part @"advisoryMessage/queryByPageAndNurseId"
#define kUpdataMessage @"advisoryMessage/update"


#define kGetAllNewsTag @"news/listNewsFlag"
//新闻列表接口
#define kNewsList_part @"news/listNews"

//登陆
#define kLoginUrl @"nurse/account/login1"
//获取瞩目信息
#define kgetZhuMuUserInfo @"nurse/account/getZhuMuUserInfo"
//护士  确认订单
#define kComfirmOrder_part @"nursing/order/applyNew1"
//发送瞩目会议消息通知
#define kSendZhumuMessage @"zhumu/sendMessage"


//获取所有基类服务
#define kAllServiceType_part  @"serviceType/getInfo"

//根据参数 获取对应服务列表
#define kServiceList_part  @"serviceNurseMapping/searchAll"

//获取服务时间列表
#define KserviceTimeList_part @"serviceTimeSettingPeriod/queryAllByUnit"



//获取护士时间模板列表
#define kserviceTimeTempetateList_prat @"stt/queryByNurseId"

//获取服务时间段列表
#define kServiceTimePeriodList @"serviceTimeSettingPeriod/queryAllByUnit"

//保存模板
#define kSaveTemplateUrl_part @"serviceTimeTemlate/saveTemplate"


//应用模板
#define kApplyTempelateUrl_part @"snt/applyTemplate"
//获取模板详情
#define kTempelateDetail_part @"stt/queryTemplateDetail"

//删除模板
#define kDeleteTempelateUrl_part @"serviceTimeTemlate/delete"

//获取整个月份的时间
#define kCurrentMonthUrl_part @"serviceNurseTime/queryWorkDate"

//查询护士服务时间(按照某天的日期)
#define kGetNurseServiceTimeByCondition @"serviceNurseTime/queryByCondition"
//保存当日的服务时间
#define kSaveDailyServiceTime @"serviceNurseTime/saveDailyServieTime"

//注册说明网址接口
#define kRegNotUrl @"http://www.hulijia360.com:8080/care-patient/wechat/view/explain.html"



#define kOnlineMesssageGet @"onlineMessage/getNewMessage"
#define kOnlineMesssageContent  @"onlineMessage/getMessageContent"
//新闻详情接口

#if DEBUG

#define kNewsDetail_url @"http://192.168.3.232:8001/news/info.html"
#define kWechatShareUrl @"http://dev.hulijia365.com/care-central/resources/nursing/view/index.html?recordId=%@"

#else

#define kNewsDetail_url @"http://www.hulijia360.com:8001/news/info.html"
#define kWechatShareUrl @"http://www.hulijia360.com:8080/care-central/resources/nursing/view/index.html?recordId=%@"
#endif





//单条留言查询
#define kSearchSingleMessage @"advisoryMessage/queryAdvisoryMessage"

//创建群组 通知后台
#define kCreateGroup @"imManager/createGroup"
//解散群组
#define kDisbandGroup @"imManager/disbandGroup"

#define kSearchAddMessmbers @"imManager/queryAddMembers"

//站内消息数量
#define kNotifyMessageCount @"notifyMessage/queryUnreadCount"

//站内消息列表
#define kNotifyMessageList @"notifyMessage/queryConditionByPage"

//标记站内消息已读
#define kMarkNotityMessage @"notifyMessage/modifyMessageHaveReadSate"
//添加发送消息
#define kSendNotityMessage @"notifyMessage/add"

//邀请上传患者档案
#define kInvitePatientUpdate @"pcr/invitePatientUploadFile"

//患者档案列表
#define kPatientRecordList @"patientContactRecord/queryByPatientId"

//增加档案
#define kPatientRecordAdd @"patientContactRecord/add"
//修改
#define kPatientUpdate @"patientContactRecord/update"
//查询档案
#define kPatientInforSearch @"patientContactRecord/queryPatientFileDetail"
//上传档案
#define kPatientInforToNurse @"patientContactRecordNurse/add"
//查询档案详情
#define kPatientInforDetail @"patientContactRecord/queryByDetail"

//添加随访记录
#define kAddFllowup @"followupInfo/add"
//修改随访记录
#define kUpdateFllowup @"followupInfo/updateAndSaveUpdateRecord"



//查看患者档案
#define kPatientContactRecordList @"patientContactRecord/queryByNurseId"


//我的问卷记录列表
#define kQuestionnaireRecordList @"questionnaire/questionnaireRecordList"
//可发送问卷的列表
#define kQuestionnaireSendList @"questionnaire/sendQuestionnaireList"

//添加反馈
#define kSaveFeedBack @"questionnaire/saveFeedback"
//发送问卷

#define kSendQuestionToPatient @"questionnaire/sendQuestionnaire"


//风险评估表的种类
#define KRiskQuestionnaire @"questionnaire/sendQuestionnaireList"

//风险评估结果
#define kRiskQuestionnaireRecords @"questionnaire/questionnaireRecordList"


//百度云推送 未登录绑定 后台
#define kBindpreBind @"baiduYunPushBind/preBind"


//获取医院列表
#define  kSearchHospitalList @"search/queryHospital"


//获取护理师列表 去选择护理人
#define  kSearchNurseList @"search/queryNurseAccount"



//删除护理记录
#define kDeleteCareRecord  @"nursing/task/delete"
//修改护理记录
#define kUpdateCareRecord  @"nursing/task/update"


//新增picc患者
#define kAdddPiccPatient @"patientPiccRecord/save"

//添加伤口记录
#define kAddWoundRecord  @"nursing/wound/add"
//获取添加的伤口记录
#define kGetWoundRecordByRecordId  @"nursing/task/getWoundRecordByRecordId"
//修改伤口记录
#define kUpdateWoundRecordByRecordId  @"nursing/wound/update"
//删除伤口记录
#define kDeleteWoundRecordByRecordId  @"nursing/task/deleteBybodyPartnameAndRecordId"

//获取伤口的护理记录
#define kGetWoundNursingRecord @"nursing/task/getWoundNursingRecord"


//获取picc患者列表
#define  kGetPiccPatientList @"patientPiccRecord/queryListByPage"

//添加picc患者
#define kAddPiccPatient @"patientPiccRecord/save"

//获取picc维护记录和拔管记录列表
#define kGetPiccRecordList @"patientPiccRecord/getRecordListByPage"


//添加PICC维护记录
#define kAddPICCPreserveRecord  @"piccMaintainRecord/add"

//修改PICC维护记录
#define kUpdatePICCPreserveRecord  @"piccMaintainRecord/update"

//删除PICC维护记录
#define kDeletePICCPreserveRecord  @"piccMaintainRecord/delete"

//根据主键查看PICC维护记录详情
#define kQueryPICCPreserveRecord  @"piccMaintainRecord/query"


//添加PICC拔管记录
#define kAddPICCExtubationRecord  @"piccExtubationRecord/add"

//修改PICC拔管记录
#define kUpdatePICCExtubationRecord  @"piccExtubationRecord/update"

//删除PICC拔管记录
#define kDeletePICCExtubationRecord  @"piccExtubationRecord/delete"

//查看PICC拔管记录
#define kQueryPICCExtubationRecord  @"piccExtubationRecord/query"

//添加picc患者
#define kAddPiccPatient @"patientPiccRecord/save"

//获取picc患者详情(患者档案)
#define kPiccRecordDetail @"patientPiccRecord/query"

//修改picc患者(患者档案)
#define kModifyPiccRecord @"patientPiccRecord/updatePatientPiccRecord"

//获取picc维护记录和拔管记录列表
#define kGetPiccRecordList @"patientPiccRecord/getRecordListByPage"

//获取picc患者列表
#define  kGetPiccPatientList @"patientPiccRecord/queryListByPage"
//删除picc患者档案
#define  kDelePatientPiccRecord @"patientPiccRecord/delete"

//增加picc 护理记录评论
#define kAddPiccRecordComment @"commentRecord/add"

//获取伤口或者 picc 记录评论
#define kCommetRecordList @"commentRecord/getCommentRecordList"


//删除 拔管记录

#define kDelePiccExtubationRecord @"piccExtubationRecord/delete"

//删除 picc维护记录

#define kDelepiccMaintainRecord @"piccMaintainRecord/delete"

//是否允许别人搜索到我

#define kAllowSearchedPost @"nurse/account/updateSearchStatus"

//是否同意成为共同护理人

#define kAgreeOrRefuseToBePatientNursingMember @"patientNursingMember/newAgreeOrRefuse"

//获取过往患者列表
#define kGetPastPatientList @"patientPiccRecord/queryHistoryListByPage"

//轮播广告接口
#define kBanner_part @"news/listBanner"

//发送一条消息给 后台
#define kWechat_AddMessage @"onlineMessage/addMessage"

//消息6大类
#define kNotifyMessageTypes @"notifyMessage/queryMessageGroupByMessageStatus"

#define weakSelf_define __weak typeof(self) weakSelf =self
#define defineWeakSelf __weak typeof(self) weakSelf =self
#define showHud [[WCPopupLayerManager shareMg] showSimple:self.view]
#define showTextOnlyForlastPage [[WCPopupLayerManager shareMg]showTextOnly:@"亲,已经是最后一页~" withView:weakSelf.view]

#define WSJSetTxt(textView,txt,initTxt) [WCTSetTextTool setTextView:(textView) text:(txt) initText:(initTxt)];
#define WSJFormatStr(str1,str2) [NSString stringWithFormat:@"%@%@",(str1),(str2)];
#define wsj_cornerRadius(view,value)   \
view.layer.cornerRadius =value;\
view.layer.masksToBounds = YES\


#define WCN_ACCOUT() [[WCDefaultManager shareMg] account]

#ifdef DEBUG

#define Log(xx, ...) NSLog(@"%s(%d): " xx, __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)

#else

#define Log(xx, ...)

#endif